package com.example.chapter06;

public class Adventure {
    public static void t(CanFight x) {
        x.fight();
    }

    public static void u(CanSwim x) {
        x.swim();
    }

    public static void v(CanFly x) {
        x.fly();
    }

    public static void w(Actioncharacter x) {
        x.fight();
    }

    public static void main(String[] args) {
        Hero h = new Hero();
        t(h); // 当作一个 CanFight 类型
        u(h); // 当作一个CanSwim类型
        v(h); // 当作一个CanFly类型
        w(h); // 当作一个 Actioncharacter 类型
    }
}
